import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import Vant from 'vant'
import 'vant/lib/index.css';
import NProgress from 'nprogress';

Vue.use(Vant)

Vue.config.productionTip = false
// eslint-disable-next-line no-unused-vars
import {initScale, removeIOSHack} from '@/utils';
// require styles
NProgress.configure({
  showSpinner: false
});

router.beforeEach((to, from, next) => {
  NProgress.start();
  next();
});

router.afterEach((to, from) => {
  removeIOSHack();
  NProgress.done();
  if (window.ga) {
    window.ga('set', 'page', to.fullPath);
    window.ga('send', 'pageview');
  }
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
